package com.process.controller;


import com.auth.common.result.Result;
import com.auth.vo.process.ProcessQueryVo;
import com.auth.vo.process.ProcessVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.process.service.OaProcessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 审批类型 前端控制器
 * </p>
 *
 * @author tang
 * @since 2023-07-23
 */
@Api(tags = "审批列表入口")
@RestController
@RequestMapping("/admin/process")
public class OaProcessController {
    private final OaProcessService processService;

    public OaProcessController(OaProcessService processService) {
        this.processService = processService;
    }

    @ApiOperation("获取分页列表")
    @GetMapping("/{page}/{limit}")
    public Result index(@PathVariable Long page,
                        @PathVariable Long limit,
                        ProcessQueryVo processQueryVo) {
        return Result.ok(processService.selectPage(new Page<ProcessVo>(page, limit), processQueryVo));
    }
}

